<template>
	<view class="box">
		<view class="top">
			<view class="header">
				<view class="left" @click="createPlan">
					<image src="@/static/img/add-icon.png"></image>
					<text>创建干预计划</text>
				</view>
				<view class="right">
					<image src="../../../static/img/quickly/intervenscheme/search.png"></image>
					<input type="text" placeholder="姓名" v-model="name" @focus="nameInput('first')" @confirm="nameInput">
					<view class="selectBox" v-if="screenArr.length > 0">
						<view class="uni-list">
							<view  @click="comSearch('all')">全部</view>
							<view  v-for="(item, index) in screenArr" :key="item.value" @click="comSearch(item)">{{item.realName}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="nav">
				<view :class="type == 1?'on':''" @click="[type = 1,deleteList = '',list = [],getlist(1,{pageIndex:1,pageSize:10,userId:SearchuserId}),nullData = false,page = 1]">干预计划</view>
				<view :class="type == 2?'on':''" @click="[type = 2,deleteList = '',list = [],getlist(2,{pageNum:1,pageSize:10,planType:'isPlan',userId:SearchuserId}),nullData = false,page = 1]">执行日期</view>
			</view>
		</view>
		<view class="bottom">
			<view v-if="type == 1">
				<comlist :isheader="false" :listtitle="listtitle" :listLabel="listLabel" :list="list" :options="options" @bindClick="bindClick" @jump="jump" :nullData="nullData"></comlist>
			</view>
			<view v-else>
				<uni-swipe-action  class="mainContent" v-for="(item,index) in list" :key="index" v-if="list.length > 0">
					<uni-swipe-action-item :right-options="options" @click="bindClick(item,'计划')">
						<view class="initalValue">
							<view class="nameBox">
								<image src="../../../static/img/quickly/intervenscheme/headPortraits.png"></image>
								<text class="name">{{item.userName}}</text>
								<text class="stateCode1" v-if="item.status == 1">正常</text>
								<text class="stateCode" v-if="item.status == 2">逾期</text>
							</view>
							<view class="carryOut" @click="carryOut(item.id)">执行</view>
						</view>
						 <!-- :url="'/pages/execute/execute?id='+item.id+'&scrollTop='+scrollTop+'&isNullData='+isNullData" -->
						<navigator class="executeData">
							<view class="executeTime">
								<view>
									<text>计划日期：</text>
									<text>{{item.createdDate}}</text>
								</view>
								<view>
									<text>主要内容：</text>
									<text>{{item.content}}</text>
								</view>
							</view>
							<view class="specificItem">
								<view>具体事项：</view>
								<text v-html="item.specificMatters"></text>
							</view>
						</navigator>
					</uni-swipe-action-item>
				</uni-swipe-action>
				<view class="nulldata" style="text-align: center;font-size: 26upx;color: #ccc;padding-bottom: 20upx;" v-if="nullData">
					<view>没有更多数据了</view>
				</view>
				<view class="noneChating" v-if="list.length <= 0">
					<image src="@/static/img/headFeature/chattingNone.png"></image>
					<view>暂无数据</view>
				</view>
			</view>
		</view>
		<u-modal v-model="showModal" :show-cancel-button="true" @confirm="Modalconfirm" :content="showContent"></u-modal>
		<u-modal v-model="showModal1" :show-cancel-button="true" @confirm="Modalconfirm1" :content="showContent1"></u-modal>
	</view>
</template>

<script src="@/static/js/quickly/intervenscheme/list.js"></script>

<style lang="scss" scoped>
	@import '@/static/css/quickly/intervenscheme/list.scss';
	.selectBox {
		position: absolute;
		right: 0;
		top: 50upx;
		width: 88px;
		max-height: 564rpx;
		z-index: 10;
		background: #fff;
		box-shadow:0px 0px 20rpx -2rpx #bdbdbd;
		border-radius: 8upx;
		view{
			padding:4rpx 10rpx;
			overflow: hidden;
			font-size: 26upx;
			line-height: 48rpx;
		}
		.uni-list-cell {
			display: flex;
		}
	}
</style>
